home *** CD-ROM | disk | FTP | other *** search
- property pTrackmanager, pStrength, pCar, pStep, pSmallInitData, pBigInitData, pBigDust, pDustPuffManager
- global gEffects
-
- on new me, tTrackManager, tCar
- pCar = tCar
- pTrackmanager = tTrackManager
- pTrackmanager.INeedAnUpdateEachFrame(me)
- pDustPuffManager = pTrackmanager.getDustPuffManager()
- me.setStrength(0)
- pStep = 0
- pSmallInitData = [#direction: point(0, 0), #startsize: 20, #endsize: 60, #duration: 5, #animProgression: 0]
- pBigInitData = [#direction: point(3, 3), #startsize: 30, #endsize: 170, #duration: 10, #animProgression: 0]
- pBigDust = 0
- return me
- end
-
- on setStrength me, tStrength
- pStrength = tStrength
- end
-
- on setBigDust me, tBig
- pBigDust = tBig
- end
-
- on Update me
- if gEffects[#dust] then
- pStep = pStep + 1
- if pStrength > 0 then
- if pCar.onScreen() then
- if (pStep mod (100 / pStrength)) <= 1 then
- tCarPos = pCar.getPosition()
- pSmallInitData[#direction] = point(random(-3, 3), random(-3, 3))
- pSmallInitData[#position] = tCarPos + (pCar.pCurrentWheelPositions[2] * 0.90000000000000002)
- pDustPuffManager.newDustPuff(pSmallInitData.duplicate())
- pSmallInitData[#position] = tCarPos + (pCar.pCurrentWheelPositions[4] * 0.90000000000000002)
- pDustPuffManager.newDustPuff(pSmallInitData.duplicate())
- end if
- end if
- end if
- end if
- end
-
- on cleanUp me
- pTrackmanager.IDontNeedAPhysicsUpdateEachFrame(me)
- pTrackmanager = 0
- pCar = 0
- pDustPuffManager = 0
- return 0
- end
-